package com.suke.czx.modules.team.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.suke.czx.common.validate.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 应用模块名称: 团队
 * 代码描述: 团队实体
 * copyright: AUZAR ALL RIGHTS RESERVED
 * company: AUZAR
 *
 * @author: 颜米晨
 * @date: 2021/09/08 1:39
 */
@Data
@ApiModel(value = "团队管理")
@EqualsAndHashCode(callSuper = true)
public class Team extends Model<Team> {

    @ApiModelProperty(value = "团队id")
    @TableId(value = "team_id", type = IdType.AUTO)
    @NotNull(groups = {TeamUpdateGroup.class}, message = "团队编码不能为空")
    public Long teamId;

    @ApiModelProperty(value = "员工id")
    @NotNull(groups = {TeamSaveGroup.class, TeamUpdateGroup.class}, message = "员工编码不能为空")
    public Long userId;

    @TableField(exist = false)
    @ApiModelProperty(value = "员工姓名")
    public String name;

    @TableField(exist = false)
    @ApiModelProperty(value = "性别")
    public Long sex;

    @TableField(exist = false)
    @ApiModelProperty(value = "岗位")
    public String jobs;

    @ApiModelProperty(value = "项目id")
    @NotNull(groups = {TeamSaveGroup.class, TeamUpdateGroup.class}, message = "项目编码不能为空")
    public Long projectId;

    @ApiModelProperty(value = "项目职责")
    @NotBlank(groups = {TeamSaveGroup.class, TeamUpdateGroup.class}, message = "项目职责不能为空")
    public String projectDuty;

    @ApiModelProperty(value = "备注")
    public String note;

    @ApiModelProperty(value = "删除标记  0：删除   1：正常")
    public Integer del;

    @ApiModelProperty(value = "创建者id")
    public Long creator;

    @ApiModelProperty(value = "创建时间")
    public Date createTime;

    @ApiModelProperty(value = "更新者id")
    public Long updater;

    @ApiModelProperty(value = "更新时间")
    public Date updateTime;

}
